package com.my.consumer.rpc;

import com.my.common.R;
import com.my.consumer.entiry.Girl;
import com.my.consumer.rpc.fallback.GirlFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @description:
 * @author: marshal
 * @date: 2021-07-14 2:13 PM
 */
@FeignClient(value = "producer", path = "/girl", fallbackFactory = GirlFallback.class)
public interface GirlClient {

    @PostMapping("/save")
    R<Girl> save(@RequestBody Girl girl);

    /**
     * 不加("id")竟然会报错
     *
     * @param id
     * @return
     */
    @GetMapping("/query/{id}")
    R<Girl> query(@PathVariable("id") int id);

}
